Skip to content

feat(context): forward the searchDuringIngestion opt-in to the retriever - #1075

Open
CalebMartinUiPath wants to merge 1 commit into
mainfrom
caleb/allow-search-during-ingestion
Open

feat(context): forward the searchDuringIngestion opt-in to the retriever#1075
CalebMartinUiPath wants to merge 1 commit into
mainfrom
caleb/allow-search-during-ingestion

Conversation

@CalebMartinUiPath

@CalebMartinUiPath CalebMartinUiPath commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Why

An agent pointed at a context index that was still ingesting failed outright instead of searching the documents indexed so far. UiPath/uipath-python#1891 adds an opt-in flag for this; this PR threads it through to the agent.

What

agent.json  →  AgentContextSettings  →  context_tool  →  ContextGroundingRetriever  →  unified_search(_async)
(UI toggle)      uipath pkg              here               here                        uipath-platform
  • ContextGroundingRetriever gains a search_during_ingestion field, forwarded on both the sync and async paths.
  • The semantic context tool reads it off resource.settings and passes it down.
  • The IngestionInProgressException handler now names the toggle in its detail text, since that is the actionable fix for the user. Its existing test asserts code and category, not the text.

One name at every layer: searchDuringIngestion in agent.json, search_during_ingestion in Python.

⚠️ Blocked on the SDK release

This repo resolves published wheels — there is no [tool.uv.sources]. The pins here are bumped to uipath-platform>=0.2.29 and uipath>=2.14.14, which do not exist on PyPI yet. CI cannot go green until UiPath/uipath-python#1891 merges and releases.

The bump is still required for correctness: without it this resolves an SDK lacking the parameter and fails at runtime with a TypeError.

I validated locally by installing the two local SDK packages editable into the venv.

Backward compatibility

Default is unchanged (False), so an ingesting index still fails fast. An agent.json predating the toggle reads as False — covered by test_agent_json_predating_the_toggle_keeps_failing_fast, which validates from a raw legacy dict rather than through the test helper, so it exercises the genuinely-absent key.

Note the vector store (ContextGroundingVectorStore) still uses the deprecated search / search_async, which keep their unconditional guard, so it cannot opt in. Only the retriever path is wired.

Testing

  • 3 new tests asserting the setting reaches the retriever: default, legacy agent.json, and opt-in.
  • Negative-checked: removed the wiring, confirmed the tests fail, restored.
  • Context tool and retriever tests green against the local SDK; ruff clean, mypy clean on the two changed files.
  • Unrelated failures on this branch also reproduce on a clean main with the same venv, so they are not from this change: 4 in test_output_file_tool.py / test_uipath_cli_tool.py, and 5 [legacy] cases in test_jsonschema_pydantic_converter_scenarios.py from feat: bump jsonschema-pydantic-converter to 0.4.1, add datamodel-code-generator backend #1055.

Version: uipath-langchain 0.17.5 → 0.17.6.

🤖 Generated with Claude Code

An agent pointed at a context index that was still ingesting failed
outright instead of searching the documents indexed so far. The SDK now
exposes search_during_ingestion on the unified search methods, and
AgentContextSettings carries the matching searchDuringIngestion flag that
the agent designer writes into agent.json.

Thread that setting through: ContextGroundingRetriever gains a
search_during_ingestion field forwarded to unified_search and
unified_search_async, and the semantic context tool reads it off the
resource settings.

The default is unchanged (False), so an ingesting index still fails fast.
The failure now names the toggle, since that is the actionable fix.

Requires uipath-platform>=0.2.27 and uipath>=2.14.13, which is where the
parameter and the settings field land.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@CalebMartinUiPath
CalebMartinUiPath force-pushed the caleb/allow-search-during-ingestion branch from b1b297d to 98c54a5 Compare September 9, 2026 20:07
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube Cloud

@CalebMartinUiPath
CalebMartinUiPath marked this pull request as ready for review September 9, 2026 23:20
Copilot AI lite review requested due to automatic review settings September 9, 2026 23:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Commit the regenerated uv.lock and add sync/async retriever forwarding tests.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Threads searchDuringIngestion from agent configuration through the context tool and retriever to synchronous and asynchronous SDK searches.

Changes:

  • Adds setting propagation and ingestion error guidance.
  • Adds default, legacy, and opt-in coverage.
  • Bumps package and SDK dependencies.
File summaries
File Summary
tests/agent/tools/test_context_tool.py Tests setting propagation behavior.
src/uipath_langchain/retrievers/context_grounding_retriever.py Forwards the flag to unified search APIs.
src/uipath_langchain/agent/tools/context_tool.py Reads configuration and passes it to the retriever.
pyproject.toml Updates package and SDK requirements.
Review details

Suppressed comments (2)

src/uipath_langchain/retrievers/context_grounding_retriever.py:58

  • The new sync SDK keyword is not covered by the retriever tests: those tests assert only include_system_indexes, while the added context-tool tests mock ContextGroundingRetriever and never reach unified_search. Removing this keyword would leave the new tests green, so add a sync retriever test that asserts both the opt-in and default values reach the SDK.
            search_during_ingestion=self.search_during_ingestion,

src/uipath_langchain/retrievers/context_grounding_retriever.py:105

  • The analogous async SDK forwarding path is also untested: the context-tool tests stop at the mocked retriever constructor, and the existing async retriever tests check only include_system_indexes. Add an async assertion for search_during_ingestion so a regression in unified_search_async cannot pass unnoticed.
            search_during_ingestion=self.search_during_ingestion,
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pyproject.toml
Comment on lines +8 to +10
"uipath>=2.14.14, <2.15.0",
"uipath-core>=0.5.29, <0.6.0",
"uipath-platform>=0.2.24, <0.3.0",
"uipath-platform>=0.2.29, <0.3.0",
folder_path=self.folder_path,
folder_key=self.folder_key,
include_system_indexes=self.include_system_indexes,
search_during_ingestion=self.search_during_ingestion,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants